import os.path
from Cheetah.Template import Template

# Update the count
if os.path.exists ( 'count.txt' ):
   count = int ( file ( 'count.txt' ).read() )
   count = count + 1
else:
   count = 1
file ( 'count.txt', 'w' ).write ( str ( count ) )

print Template ( file = 'counter.tmpl', searchList =
[{ 'counter': str ( count ) }] )p